package com.zy.configs;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @program: shopping153_cloud
 * @description: RestTemplate的配置类, 用于托管RestTemplate对象
 * @author: zy
 * @create: 2025-08-21 09:22
 */
@Configuration
public class RestTemplateConfig {
    @Bean
    @LoadBalanced    //对这个RestTemplate开启负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }





}
